package com.laiyizhan.cms.manager.service.impl;

import com.laiyizhan.cms.manager.request.AdminUserRequest;
import com.laiyizhan.cms.manager.service.IAdminUserService;
import com.laiyizhan.common.mapper.AdminMapper;
import com.laiyizhan.common.mapper.StateMapper;
import com.laiyizhan.common.model.Admin;
import com.laiyizhan.common.model.State;
import com.laiyizhan.common.utils.SecurityTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.swing.plaf.synth.SynthTextAreaUI;

@Service
public class AdminUserServiceImpl implements IAdminUserService {

    @Autowired
    AdminMapper adminMapper;
    @Override
    public Admin checkUser(AdminUserRequest request) {
        Admin admin = adminMapper.selectByUsername(request.getUsername());
        if (admin != null) {
            String db_password = admin.getPassword();
            if (request.getPassword().equals(db_password)) {
                return admin;
            }
        }
        return null;
    }






}